home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / dialogs.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  15.3 KB  |  394 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'Dialogs.pas' rev: 3.00
  6.  
  7. #ifndef DialogsHPP
  8. #define DialogsHPP
  9. #include <StdCtrls.hpp>
  10. #include <Forms.hpp>
  11. #include <Controls.hpp>
  12. #include <Graphics.hpp>
  13. #include <Classes.hpp>
  14. #include <CommDlg.hpp>
  15. #include <SysUtils.hpp>
  16. #include <Messages.hpp>
  17. #include <Windows.hpp>
  18. #include <SysInit.hpp>
  19. #include <System.hpp>
  20.  
  21. //-- user supplied -----------------------------------------------------------
  22.  
  23. namespace Dialogs
  24. {
  25. //-- type declarations -------------------------------------------------------
  26. class DELPHICLASS TCommonDialog;
  27. class PASCALIMPLEMENTATION TCommonDialog : public Classes::TComponent 
  28. {
  29.     typedef Classes::TComponent inherited;
  30.     
  31. private:
  32.     bool FCtl3D;
  33.     void *FDefWndProc;
  34.     Classes::THelpContext FHelpContext;
  35.     HWND FHandle;
  36.     void *FObjectInstance;
  37.     char *FTemplate;
  38.     Classes::TNotifyEvent FOnClose;
  39.     Classes::TNotifyEvent FOnShow;
  40.     MESSAGE void __fastcall WMDestroy(Messages::TWMNoParams &Message);
  41.     MESSAGE void __fastcall WMInitDialog(Messages::TWMInitDialog &Message);
  42.     MESSAGE void __fastcall WMNCDestroy(Messages::TWMNoParams &Message);
  43.     void __fastcall MainWndProc(Messages::TMessage &Message);
  44.     
  45. protected:
  46.     virtual void __fastcall DefaultHandler(void *Message);
  47.     DYNAMIC void __fastcall DoClose(void);
  48.     DYNAMIC void __fastcall DoShow(void);
  49.     virtual void __fastcall WndProc(Messages::TMessage &Message);
  50.     virtual bool __fastcall MessageHook(Messages::TMessage &Msg);
  51.     virtual BOOL __fastcall TaskModalDialog(void * DialogFunc, void *DialogData);
  52.     virtual bool __fastcall Execute(void) = 0;
  53.     __property char * Template = {read=FTemplate, write=FTemplate};
  54.     
  55. public:
  56.     __fastcall virtual TCommonDialog(Classes::TComponent* AOwner);
  57.     __fastcall virtual ~TCommonDialog(void);
  58.     __property HWND Handle = {read=FHandle, nodefault};
  59.     
  60. __published:
  61.     __property bool Ctl3D = {read=FCtl3D, write=FCtl3D, default=1};
  62.     __property Classes::THelpContext HelpContext = {read=FHelpContext, write=FHelpContext, default=0};
  63.     __property Classes::TNotifyEvent OnClose = {read=FOnClose, write=FOnClose};
  64.     __property Classes::TNotifyEvent OnShow = {read=FOnShow, write=FOnShow};
  65. };
  66.  
  67. enum TOpenOption { ofReadOnly, ofOverwritePrompt, ofHideReadOnly, ofNoChangeDir, ofShowHelp, ofNoValidate, 
  68.     ofAllowMultiSelect, ofExtensionDifferent, ofPathMustExist, ofFileMustExist, ofCreatePrompt, ofShareAware, 
  69.     ofNoReadOnlyReturn, ofNoTestFileCreate, ofNoNetworkButton, ofNoLongNames, ofOldStyleDialog, ofNoDereferenceLinks 
  70.     };
  71.  
  72. typedef Set<TOpenOption, ofReadOnly, ofNoDereferenceLinks>  TOpenOptions;
  73.  
  74. enum TFileEditStyle { fsEdit, fsComboBox };
  75.  
  76. class DELPHICLASS TOpenDialog;
  77. class PASCALIMPLEMENTATION TOpenDialog : public Dialogs::TCommonDialog 
  78. {
  79.     typedef Dialogs::TCommonDialog inherited;
  80.     
  81. private:
  82.     Classes::TStrings* FHistoryList;
  83.     TOpenOptions FOptions;
  84.     System::AnsiString FFilter;
  85.     int FFilterIndex;
  86.     int FCurrentFilterIndex;
  87.     System::AnsiString FInitialDir;
  88.     System::AnsiString FTitle;
  89.     System::AnsiString FDefaultExt;
  90.     System::AnsiString FFileName;
  91.     Classes::TStrings* FFiles;
  92.     TFileEditStyle FFileEditStyle;
  93.     Classes::TNotifyEvent FOnSelectionChange;
  94.     Classes::TNotifyEvent FOnFolderChange;
  95.     Classes::TNotifyEvent FOnTypeChange;
  96.     Forms::TCloseQueryEvent FOnCanClose;
  97.     System::AnsiString __fastcall GetFileName(void);
  98.     int __fastcall GetFilterIndex(void);
  99.     void __fastcall ReadFileEditStyle(Classes::TReader* Reader);
  100.     void __fastcall SetHistoryList(Classes::TStrings* Value);
  101.     void __fastcall SetInitialDir(const System::AnsiString Value);
  102.     
  103. protected:
  104.     bool __fastcall CanClose(tagOFNA &OpenFileName);
  105.     DYNAMIC bool __fastcall DoCanClose(void);
  106.     BOOL __fastcall DoExecute(void * Func);
  107.     DYNAMIC void __fastcall DoSelectionChange(void);
  108.     DYNAMIC void __fastcall DoFolderChange(void);
  109.     DYNAMIC void __fastcall DoTypeChange(void);
  110.     virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
  111.     void __fastcall GetFileNames(tagOFNA &OpenFileName);
  112.     virtual Windows::TRect __fastcall GetStaticRect(void);
  113.     virtual void __fastcall WndProc(Messages::TMessage &Message);
  114.     
  115. public:
  116.     __fastcall virtual TOpenDialog(Classes::TComponent* AOwner);
  117.     __fastcall virtual ~TOpenDialog(void);
  118.     virtual bool __fastcall Execute(void);
  119.     __property TFileEditStyle FileEditStyle = {read=FFileEditStyle, write=FFileEditStyle, nodefault};
  120.     __property Classes::TStrings* Files = {read=FFiles};
  121.     __property Classes::TStrings* HistoryList = {read=FHistoryList, write=SetHistoryList};
  122.     
  123. __published:
  124.     __property System::AnsiString DefaultExt = {read=FDefaultExt, write=FDefaultExt};
  125.     __property System::AnsiString FileName = {read=GetFileName, write=FFileName};
  126.     __property System::AnsiString Filter = {read=FFilter, write=FFilter};
  127.     __property int FilterIndex = {read=GetFilterIndex, write=FFilterIndex, default=1};
  128.     __property System::AnsiString InitialDir = {read=FInitialDir, write=SetInitialDir};
  129.     __property TOpenOptions Options = {read=FOptions, write=FOptions, default=4};
  130.     __property System::AnsiString Title = {read=FTitle, write=FTitle};
  131.     __property Forms::TCloseQueryEvent OnCanClose = {read=FOnCanClose, write=FOnCanClose};
  132.     __property Classes::TNotifyEvent OnFolderChange = {read=FOnFolderChange, write=FOnFolderChange};
  133.     __property Classes::TNotifyEvent OnSelectionChange = {read=FOnSelectionChange, write=FOnSelectionChange
  134.         };
  135.     __property Classes::TNotifyEvent OnTypeChange = {read=FOnTypeChange, write=FOnTypeChange};
  136. };
  137.  
  138. class DELPHICLASS TSaveDialog;
  139. class PASCALIMPLEMENTATION TSaveDialog : public Dialogs::TOpenDialog 
  140. {
  141.     typedef Dialogs::TOpenDialog inherited;
  142.     
  143. __published:
  144.     virtual bool __fastcall Execute(void);
  145. public:
  146.     /* TOpenDialog.Create */ __fastcall virtual TSaveDialog(Classes::TComponent* AOwner) : Dialogs::TOpenDialog(
  147.         AOwner) { }
  148.     /* TOpenDialog.Destroy */ __fastcall virtual ~TSaveDialog(void) { }
  149.     
  150. };
  151.  
  152. enum TColorDialogOption { cdFullOpen, cdPreventFullOpen, cdShowHelp, cdSolidColor, cdAnyColor };
  153.  
  154. typedef Set<TColorDialogOption, cdFullOpen, cdAnyColor>  TColorDialogOptions;
  155.  
  156. typedef int TCustomColors[16];
  157.  
  158. class DELPHICLASS TColorDialog;
  159. class PASCALIMPLEMENTATION TColorDialog : public Dialogs::TCommonDialog 
  160. {
  161.     typedef Dialogs::TCommonDialog inherited;
  162.     
  163. private:
  164.     Graphics::TColor FColor;
  165.     TColorDialogOptions FOptions;
  166.     Classes::TStrings* FCustomColors;
  167.     void __fastcall SetCustomColors(Classes::TStrings* Value);
  168.     
  169. public:
  170.     __fastcall virtual TColorDialog(Classes::TComponent* AOwner);
  171.     __fastcall virtual ~TColorDialog(void);
  172.     virtual bool __fastcall Execute(void);
  173.     
  174. __published:
  175.     __property Graphics::TColor Color = {read=FColor, write=FColor, default=0};
  176.     __property Ctl3D ;
  177.     __property Classes::TStrings* CustomColors = {read=FCustomColors, write=SetCustomColors};
  178.     __property TColorDialogOptions Options = {read=FOptions, write=FOptions, default=0};
  179. };
  180.  
  181. enum TFontDialogOption { fdAnsiOnly, fdTrueTypeOnly, fdEffects, fdFixedPitchOnly, fdForceFontExist, 
  182.     fdNoFaceSel, fdNoOEMFonts, fdNoSimulations, fdNoSizeSel, fdNoStyleSel, fdNoVectorFonts, fdShowHelp, 
  183.     fdWysiwyg, fdLimitSize, fdScalableOnly, fdApplyButton };
  184.  
  185. typedef Set<TFontDialogOption, fdAnsiOnly, fdApplyButton>  TFontDialogOptions;
  186.  
  187. enum TFontDialogDevice { fdScreen, fdPrinter, fdBoth };
  188.  
  189. typedef void __fastcall (__closure *TFDApplyEvent)(System::TObject* Sender, HWND Wnd);
  190.  
  191. class DELPHICLASS TFontDialog;
  192. class PASCALIMPLEMENTATION TFontDialog : public Dialogs::TCommonDialog 
  193. {
  194.     typedef Dialogs::TCommonDialog inherited;
  195.     
  196. private:
  197.     Graphics::TFont* FFont;
  198.     TFontDialogDevice FDevice;
  199.     TFontDialogOptions FOptions;
  200.     TFDApplyEvent FOnApply;
  201.     int FMinFontSize;
  202.     int FMaxFontSize;
  203.     bool FFontCharsetModified;
  204.     bool FFontColorModified;
  205.     void __fastcall DoApply(HWND Wnd);
  206.     void __fastcall SetFont(Graphics::TFont* Value);
  207.     void __fastcall UpdateFromLogFont(const tagLOGFONTA &LogFont);
  208.     
  209. protected:
  210.     DYNAMIC void __fastcall Apply(HWND Wnd);
  211.     virtual void __fastcall WndProc(Messages::TMessage &Message);
  212.     
  213. public:
  214.     __fastcall virtual TFontDialog(Classes::TComponent* AOwner);
  215.     __fastcall virtual ~TFontDialog(void);
  216.     virtual bool __fastcall Execute(void);
  217.     
  218. __published:
  219.     __property Graphics::TFont* Font = {read=FFont, write=SetFont};
  220.     __property TFontDialogDevice Device = {read=FDevice, write=FDevice, default=0};
  221.     __property int MinFontSize = {read=FMinFontSize, write=FMinFontSize, nodefault};
  222.     __property int MaxFontSize = {read=FMaxFontSize, write=FMaxFontSize, nodefault};
  223.     __property TFontDialogOptions Options = {read=FOptions, write=FOptions, default=4};
  224.     __property TFDApplyEvent OnApply = {read=FOnApply, write=FOnApply};
  225. };
  226.  
  227. class DELPHICLASS TPrinterSetupDialog;
  228. class PASCALIMPLEMENTATION TPrinterSetupDialog : public Dialogs::TCommonDialog 
  229. {
  230.     typedef Dialogs::TCommonDialog inherited;
  231.     
  232. public:
  233.     virtual bool __fastcall Execute(void);
  234. public:
  235.     /* TCommonDialog.Create */ __fastcall virtual TPrinterSetupDialog(Classes::TComponent* AOwner) : Dialogs::
  236.         TCommonDialog(AOwner) { }
  237.     /* TCommonDialog.Destroy */ __fastcall virtual ~TPrinterSetupDialog(void) { }
  238.     
  239. };
  240.  
  241. enum TPrintRange { prAllPages, prSelection, prPageNums };
  242.  
  243. enum TPrintDialogOption { poPrintToFile, poPageNums, poSelection, poWarning, poHelp, poDisablePrintToFile 
  244.     };
  245.  
  246. typedef Set<TPrintDialogOption, poPrintToFile, poDisablePrintToFile>  TPrintDialogOptions;
  247.  
  248. class DELPHICLASS TPrintDialog;
  249. class PASCALIMPLEMENTATION TPrintDialog : public Dialogs::TCommonDialog 
  250. {
  251.     typedef Dialogs::TCommonDialog inherited;
  252.     
  253. private:
  254.     int FFromPage;
  255.     int FToPage;
  256.     bool FCollate;
  257.     TPrintDialogOptions FOptions;
  258.     bool FPrintToFile;
  259.     TPrintRange FPrintRange;
  260.     int FMinPage;
  261.     int FMaxPage;
  262.     int FCopies;
  263.     void __fastcall SetNumCopies(int Value);
  264.     
  265. public:
  266.     virtual bool __fastcall Execute(void);
  267.     
  268. __published:
  269.     __property bool Collate = {read=FCollate, write=FCollate, default=0};
  270.     __property int Copies = {read=FCopies, write=SetNumCopies, default=0};
  271.     __property int FromPage = {read=FFromPage, write=FFromPage, default=0};
  272.     __property int MinPage = {read=FMinPage, write=FMinPage, default=0};
  273.     __property int MaxPage = {read=FMaxPage, write=FMaxPage, default=0};
  274.     __property TPrintDialogOptions Options = {read=FOptions, write=FOptions, default=0};
  275.     __property bool PrintToFile = {read=FPrintToFile, write=FPrintToFile, default=0};
  276.     __property TPrintRange PrintRange = {read=FPrintRange, write=FPrintRange, default=0};
  277.     __property int ToPage = {read=FToPage, write=FToPage, default=0};
  278. public:
  279.     /* TCommonDialog.Create */ __fastcall virtual TPrintDialog(Classes::TComponent* AOwner) : Dialogs::
  280.         TCommonDialog(AOwner) { }
  281.     /* TCommonDialog.Destroy */ __fastcall virtual ~TPrintDialog(void) { }
  282.     
  283. };
  284.  
  285. enum TFindOption { frDown, frFindNext, frHideMatchCase, frHideWholeWord, frHideUpDown, frMatchCase, 
  286.     frDisableMatchCase, frDisableUpDown, frDisableWholeWord, frReplace, frReplaceAll, frWholeWord, frShowHelp 
  287.     };
  288.  
  289. typedef Set<TFindOption, frDown, frShowHelp>  TFindOptions;
  290.  
  291. typedef HWND __stdcall (*TFindReplaceFunc)(tagFINDREPLACEA &FindReplace);
  292.  
  293. class DELPHICLASS TFindDialog;
  294. class PASCALIMPLEMENTATION TFindDialog : public Dialogs::TCommonDialog 
  295. {
  296.     typedef Dialogs::TCommonDialog inherited;
  297.     
  298. private:
  299.     TFindOptions FOptions;
  300.     tagPOINT FPosition;
  301.     TFindReplaceFunc FFindReplaceFunc;
  302.     Controls::TWinControl* FRedirector;
  303.     Classes::TNotifyEvent FOnFind;
  304.     Classes::TNotifyEvent FOnReplace;
  305.     HWND FFindHandle;
  306.     tagFINDREPLACEA FFindReplace;
  307.     char FFindText[256];
  308.     char FReplaceText[256];
  309.     System::AnsiString __fastcall GetFindText(void);
  310.     int __fastcall GetLeft(void);
  311.     tagPOINT __fastcall GetPosition(void);
  312.     System::AnsiString __fastcall GetReplaceText(void);
  313.     int __fastcall GetTop(void);
  314.     void __fastcall SetFindText(const System::AnsiString Value);
  315.     void __fastcall SetLeft(int Value);
  316.     void __fastcall SetPosition(const tagPOINT &Value);
  317.     void __fastcall SetReplaceText(const System::AnsiString Value);
  318.     void __fastcall SetTop(int Value);
  319.     __property System::AnsiString ReplaceText = {read=GetReplaceText, write=SetReplaceText};
  320.     __property Classes::TNotifyEvent OnReplace = {read=FOnReplace, write=FOnReplace};
  321.     
  322. protected:
  323.     virtual bool __fastcall MessageHook(Messages::TMessage &Msg);
  324.     DYNAMIC void __fastcall Find(void);
  325.     DYNAMIC void __fastcall Replace(void);
  326.     
  327. public:
  328.     __fastcall virtual TFindDialog(Classes::TComponent* AOwner);
  329.     __fastcall virtual ~TFindDialog(void);
  330.     void __fastcall CloseDialog(void);
  331.     virtual bool __fastcall Execute(void);
  332.     __property int Left = {read=GetLeft, write=SetLeft, nodefault};
  333.     __property tagPOINT Position = {read=GetPosition, write=SetPosition};
  334.     __property int Top = {read=GetTop, write=SetTop, nodefault};
  335.     
  336. __published:
  337.     __property System::AnsiString FindText = {read=GetFindText, write=SetFindText};
  338.     __property TFindOptions Options = {read=FOptions, write=FOptions, default=1};
  339.     __property Classes::TNotifyEvent OnFind = {read=FOnFind, write=FOnFind};
  340. };
  341.  
  342. class DELPHICLASS TReplaceDialog;
  343. class PASCALIMPLEMENTATION TReplaceDialog : public Dialogs::TFindDialog 
  344. {
  345.     typedef Dialogs::TFindDialog inherited;
  346.     
  347. public:
  348.     __fastcall virtual TReplaceDialog(Classes::TComponent* AOwner);
  349.     
  350. __published:
  351.     __property ReplaceText ;
  352.     __property OnReplace ;
  353. public:
  354.     /* TFindDialog.Destroy */ __fastcall virtual ~TReplaceDialog(void) { }
  355.     
  356. };
  357.  
  358. enum TMsgDlgType { mtWarning, mtError, mtInformation, mtConfirmation, mtCustom };
  359.  
  360. enum TMsgDlgBtn { mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, mbAll, mbNoToAll, mbYesToAll, 
  361.     mbHelp };
  362.  
  363. typedef Set<TMsgDlgBtn, mbYes, mbHelp>  TMsgDlgButtons;
  364.  
  365. //-- var, const, procedure ---------------------------------------------------
  366. #define MaxCustomColors (Byte)(16)
  367. #define mbYesNoCancel (System::Set<TMsgDlgBtn, mbYes, mbHelp> () << mbYes << mbNo << mbCancel )
  368. #define mbOKCancel (System::Set<TMsgDlgBtn, mbYes, mbHelp> () << mbOK << mbCancel )
  369. #define mbAbortRetryIgnore (System::Set<TMsgDlgBtn, mbYes, mbHelp> () << mbAbort << mbRetry << mbIgnore \
  370.     )
  371. extern PACKAGE Forms::TForm* __fastcall CreateMessageDialog(const System::AnsiString Msg, TMsgDlgType 
  372.     DlgType, TMsgDlgButtons Buttons);
  373. extern PACKAGE int __fastcall MessageDlg(const System::AnsiString Msg, TMsgDlgType DlgType, TMsgDlgButtons 
  374.     Buttons, int HelpCtx);
  375. extern PACKAGE int __fastcall MessageDlgPos(const System::AnsiString Msg, TMsgDlgType DlgType, TMsgDlgButtons 
  376.     Buttons, int HelpCtx, int X, int Y);
  377. extern PACKAGE int __fastcall MessageDlgPosHelp(const System::AnsiString Msg, TMsgDlgType DlgType, TMsgDlgButtons 
  378.     Buttons, int HelpCtx, int X, int Y, const System::AnsiString HelpFileName);
  379. extern PACKAGE void __fastcall ShowMessage(const System::AnsiString Msg);
  380. extern PACKAGE void __fastcall ShowMessageFmt(const System::AnsiString Msg, const System::TVarRec * 
  381.     Params, const int Params_Size);
  382. extern PACKAGE void __fastcall ShowMessagePos(const System::AnsiString Msg, int X, int Y);
  383. extern PACKAGE bool __fastcall InputQuery(const System::AnsiString ACaption, const System::AnsiString 
  384.     APrompt, System::AnsiString &Value);
  385. extern PACKAGE System::AnsiString __fastcall InputBox(const System::AnsiString ACaption, const System::AnsiString 
  386.     APrompt, const System::AnsiString ADefault);
  387.  
  388. }    /* namespace Dialogs */
  389. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  390. using namespace Dialogs;
  391. #endif
  392. //-- end unit ----------------------------------------------------------------
  393. #endif    // Dialogs
  394.